package com.tarena.day1008;

public class WeiYunSuan {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		int d1 = 1; // 00000000 00000000 00000000 00000001
		int d2 = 2; // 00000000 00000000 00000000 00000010
		int d3 = 4; // 00000000 00000000 00000000 00000100
		           // +-----------------------------------------------------------
		            // 00000000 00000000 00000000 00000111
		int di = d1 | d2 | d3;
		//将24位int彩色,拆分为颜色分量rgb
		// r g b
		int color = 0x685FBF;      // 00000000 01101000 01011111 10111111
		int mask = 0xff;           // 00000000 00000000 00000000 11111111
		int blue = color & mask;   // & --------------------------------------
		                           // 00000000 00000000 00000000 10111111
		
		int green=(color>>>8)&mask;
		int red=(color>>>16)&mask;
		System.out.println(red);//104
		System.out.println(green);//95
		System.out.println(blue);//191
//		//反色
//		int c= ~color;
//		System.out.println(c);

	}

}
